﻿using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace Bot.Salesforce.Extension
{
    public static class HttpClientFactoryExtensions
    {
        public static async Task<string> SendAsync(this IHttpClientFactory httpClientFactory, HttpRequestMessage request)
        {
            var client = httpClientFactory.CreateClient();
            var httpResponseMessage = await client.SendAsync(request);
            var response = await httpResponseMessage.Content.ReadAsStringAsync();
            return response;
        }
    }
}
